#include <stdio.h>
#include <string.h>
int main(int argc, char const *argv[])
{
	int N=1001,n,k;
	int lights[N];
	scanf("%d%d",&n,&k);
	memset(lights,0,sizeof(lights));
	for (int i = 1; i <=k; ++i)
	{
		for (int j = 0; j <=n; j+=i)
		{
			lights[j]^=1;
		}
	}

	for (int i = 1; i <=n; ++i)
	{
		if(lights[i]==1)
			printf("%d ",i);
	}
	printf("\n");
	return 0;
}